package com.util.zip;

import org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator;
import org.apache.commons.compress.parallel.ScatterGatherBackingStoreSupplier;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 压缩文件创建者 <br>
 * date：2020-12-26 13:57
 *
 * @author yuanweilin
 * @version 1.0
 * @since JDK 1.8
 */
public class ZipCreator extends ParallelScatterZipCreator {

    public ZipCreator() {
        this(Runtime.getRuntime().availableProcessors());
    }

    public ZipCreator(int nThreads) {
        this(Executors.newFixedThreadPool(nThreads));
    }

    public ZipCreator(ExecutorService executorService) {
        super(executorService);
    }

    public ZipCreator(ExecutorService executorService, ScatterGatherBackingStoreSupplier backingStoreSupplier) {
        super(executorService, backingStoreSupplier);
    }
}
